package com.honghu.villagepost.entity

import android.os.Parcelable
import com.honghu.villagepost.entity.dao.GoodsEntity
import com.wuhenzhizao.sku.bean.Sku
import kotlinx.android.parcel.Parcelize

/**
 * @author: mqwang
 * @create: 1/27/21 3:37 PM
 * @Description:
 */
data class Goods(
        var cid: Int,//分类id
        var id: Int,
        var catName: String?,//分类名称
        var goodsSn: String?,//商品货号
        var majorPic: String?,//商品主图
        var name: String?,//商品名称
        var description: String?,//商品描述
        var isListing: Int,//是否上架
        var shopId: Int,//店铺ID
        var shopType: Int,//店铺类型
        var shopName: String?,//店铺名称
        var shopLogo: String?,//店铺图片logo
        var price: Double,//商品价格
        var goodsPicList: MutableList<Image>,//图片列表
        var skuList: MutableList<Sku>,//sku列表，商品尺寸规格列表
        var goodsSkuList: MutableList<GoodsSku>


) : BaseEntity<Goods>(){
    fun covertGoodsEntity(): GoodsEntity {
        var goodsEntity = GoodsEntity()
        goodsEntity.id = id
        goodsEntity.cid = cid
        goodsEntity.catName = catName
        goodsEntity.goodsSn = goodsSn
        goodsEntity.majorPic = majorPic
        goodsEntity.name = name
        goodsEntity.description = description
        goodsEntity.isListing = isListing
        goodsEntity.shopId = shopId.toLong()
        goodsEntity.shopType = shopType
        goodsEntity.shopName = shopName
        goodsEntity.shopLogo = shopLogo
        goodsEntity.price = price
        return goodsEntity
    }
}




